package com.gosuncn.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * PostConstruct > InitializingBean > ContextRefreshedEvent > ApplicationRunner > CommandLineRunner > ApplicationReadyEvent 执行顺序
 * 应用启动完成监听器
 */
@Component
@Slf4j
public class ApplicationReadyListener  implements ApplicationListener<ApplicationReadyEvent> {
    @Override
    public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
        log.info("Application Ready 启动成功");
        //do something
    }
}
